﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Grishko.SerilizeTools;
using Grishko.DataTier;

namespace OutdoorLib.WS
{
    /// <summary>
    /// Поставщик экземпялров
    /// </summary>
    public class ws_EntitySource
    {
        public static List<TypeMapItem> GetSource()
        {
            List<TypeMapItem> result = new List<TypeMapItem>();
            TypeMapItem i = new TypeMapItem() { TagNameID = "EmployeeList" };
            i.TypeName = "OutdoorLib.BaseEntity.SP.EmployeeListWhere";
            i.AssemblyName = "OutdoorLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null";
            result .Add (i);
            
            return result;
        }

        public static object ActivateEntity(string TagName, Type defType)
        {
            return EntityActivator.CreateInstance (TagName , defType);
        }

        /// <summary>
        /// Создать объект на основании его TagName
        /// </summary>
        /// <param name="TagName"></param>
        /// <returns></returns>
        public static object ActivateEntity(string TagName)
        {
            return EntityActivator.CreateInstance__(TagName);
        }

    }
}
